package pack0719.com;

import pack0719.com.Apple;
import pack0719.com.Banana;
import pack0719.com.Fruit;

//工厂设计模式
public class FruitFactory {

    public static Fruit createFruit(int n){
        if(n==1){
            return new Apple();
        }else if(n==2){
            return new Banana();
        }else{
            return null;
        }
    }
}
